//- Copyright (c) 2016 Lucky Byte, Inc.
extends trstat

append form_items
  .field.nine.wide
    .ui.buttons.right.floated.small.compact
      button.ui.green.button.labeled.icon(type="submit") 查 询
        i.icon.search

block thead
  tr
    th.collapsing.center.aligned(rowspan="2")
    th.center.aligned(rowspan="2") 资金池代号
    th.center.aligned(rowspan="2") 本期起始余额
    th.center.aligned(colspan="2") 本期变动总额
    th.center.aligned(rowspan="2") 当前资金余额
    th.center.aligned(rowspan="2") 资金总额
    th.center.aligned(rowspan="2") 代理商名称
    th.center.aligned(rowspan="2") 联系人
  tr
    th.center.aligned 充值
    th.center.aligned 手续费

block tbody
  each record, index in records
    tr
      td.collapsing.center.aligned(data-content="查看资金变动明细"
        data-variation="small very wide")
        a(href="/p2/fund/alter/#{record.p2_fund}" +
          "?start_date=#{start_date}&end_date=#{end_date}")= index + 1
      td.center.aligned= record.fund_name
      td.center.aligned ¥ #{fmtamt(record.remains)}
      td.center.aligned ¥ #{fmtamt(record.type_1_amt)}
      td.center.aligned ¥ #{fmtamt(record.type_2_amt)}
      td.center.aligned ¥ #{fmtamt(record.fund_remains)}
      td.center.aligned ¥ #{fmtamt(record.fund_total)}
      td.center.aligned= record.fund_agent
      td.center.aligned= record.fund_contact
  else
    tr
      td.collapsing.center.aligned.warning(colspan="9") 无数据
